{% load djblets_utils %}
{% load i18n %}
{% load reviewtags %}
 <div class="header">
  {% star review_request %}
  <div id="summary_wrapper"><label>{% trans "Summary" %}: </label><h1 id="summary">{{review_request_details.summary|escape}}</h1></div>
  <p id="status">
   {{review_request.get_status_display}}<br />
   {% blocktrans  with review_request_details.last_updated|timesince as lastupdated %}Updated {{ lastupdated}} ago {% endblocktrans %}
  </p>
 </div>
 <table id="details">
  <colgroup>
   <col width="0%" />
   <col width="50%" />
  </colgroup>
  <colgroup>
   <col width="0%" />
   <col width="50%" />
  </colgroup>
  <tr>
   <td class="label"><label for="submitter">{% trans "Submitter" %}:</label></td>
   <td class="value"><a id="submitter" href="{% url user review_request.submitter %}">{{review_request.submitter|user_displayname}}</a></td>
   <td class="caption" colspan="2">{% trans "Reviewers" %}</td>
  </tr>
  <tr>
   <td class="label"><label for="branch">{% trans "Branch" %}:</label></td>
   <td class="value"><span id="branch">{{review_request_details.branch|safe}}</span></td>
   <td class="indented label"><label for="target_groups">{% trans "Groups" %}:</label></td>
   <td class="value"><span id="target_groups">
{%  for group in review_request_details.target_groups.all %}
<a href="{% url group group %}">{{group}}</a>{%if not forloop.last %}, {%endif %}
{%  endfor %}
  </span></td>
  </tr>
  <tr>
   <td class="label"><label for="bugs_closed">{% trans "Bugs" %}:</label></td>
   <td class="value"><span id="bugs_closed">
{%  for bug in review_request_details.get_bug_list %}
{%   if review_request.repository.bug_tracker %}<a href={{bug|bug_url:review_request}}>{{bug}}</a>{% else %}{{bug}}{% endif %}{% if not forloop.last %}, {% endif %}
{%  endfor %}
  </span></td>
   <td class="indented label"><label for="target_people">{% trans "People" %}:</label></td>
   <td class="value"><span id="target_people">
{%  for person in review_request_details.target_people.all %}
<a href="{% url user person %}"{% if not person.is_active %} class="inactive"{% endif %}>{{person}}</a>{% if not forloop.last %}, {% endif %}
{%  endfor %}
  </span></td>
  </tr>
  <tr>
   <td class="label"><label for="changenum">{% trans "Change Number" %}:</label></td>
   <td class="value"><span id="changenum">{{review_request.changenum}}</span></td>
   <td class="label"><label for="repository">{% trans "Repository" %}:</label></td>
   <td class="value"><span id="repository">{{review_request.repository}}</span></td>
  </tr>
 </table>
 <div class="content">
  <label for="description">{% trans "Description" %}:</label>
  <pre id="description">{{review_request_details.description|escape}}</pre>
 </div>
 <div class="content">
  <label for="testing_done">{% trans "Testing Done" %}:</label>
  <pre id="testing_done">{{review_request_details.testing_done|escape}}</pre>
 </div>
 {% if review_request_details.screenshots.count %}
 <div class="content clearfix">
  <label for="images">{% trans "Screenshots" %}:</label>
  {% for image in review_request_details.screenshots.all %}
   <div class="screenshot-container">
    <a href="{{image.get_absolute_url}}">{{image.thumb}}</a><br />
    <div class="screenshot-caption">
     <a href="{{image.get_absolute_url}}" id="screenshot_{{image.id}}_caption">{{image.caption}}</a>
     {% ifuserorperm review_request.submitter "reviews.delete_screenshot" %}
      <a href="s/{{image.id}}/delete/"><img src="{{MEDIA_URL}}rb/images/delete.png" alt="{% trans "Delete Screenshot" %}" /></a>
     {% endifuserorperm %}
    </div>
   </div>
  {% endfor %}
 </div>
 {% endif %}
